'''
Author: error: git config user.name && git config user.email & please set dead value or install git
Date: 2022-11-11 13:11:02
LastEditors: error: git config user.name && git config user.email & please set dead value or install git
LastEditTime: 2022-11-11 13:58:56
FilePath: \新建文件夹 (2)\选择排序.py
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
'''
def getmin(a):
    min=a[0]
    min_index=0
    for i in range(0,len(a)):
        if a[i]<min:
           min=a[i]
           min_index=i 
    return min_index
def selectsort(a):
    newa=[]
    for i in range(0,len(a)):
        min_index=getmin(a)
        newa.append(a.pop(min_index))
    return newa
a=[1,4,2,8,5,7,3,9]
print(selectsort(a))        



